<template>
  <div>
    <h1>我是父组件</h1>
    <button @click="isShow = !isShow">子组件的显示与隐藏</button>
    <Child v-if="isShow" />
  </div>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue'
import Child from './components/Child.vue'

export default defineComponent({
  name: 'App',
  components: { Child },
  setup() {
    const isShow = ref(true)
    return {
      isShow
    }
  }
})
</script>

<style scoped>
</style>